import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import "./assets/element-ui-base.css";
import "./assets/index.css";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import axios from "./utils/axios";
import store from "./store"; // 引入 store
import "element-theme-darkplus/lib/index.css";
import "font-awesome/css/font-awesome.min.css";

// 全局注册axios
Vue.prototype.$axios = axios;

Vue.use(ElementUI);
Vue.config.productionTip = false;
// console.log("VUE_APP_API_URL: " + process.env.VUE_APP_API_URL);
// if (process.env.NODE_ENV === "development") {
//   crossEnv("VUE_APP_API_URL=http://localhost:3000/api");
// } else if (process.env.NODE_ENV === "production") {
//   crossEnv("VUE_APP_API_URL=http://www.example.com/");
// }

new Vue({
  el: "#app",
  store, // 注入 store
  router,
  render: (h) => h(App),
});
